import { BaseEntity } from "src/common/entites/base";
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity('monitor_login_log', {
    comment: '用户访问记录',
})
export class LoginLogEntity extends BaseEntity {
    @PrimaryGeneratedColumn({ type: 'int', name: 'info_id', comment: '访问ID' })
    public id: number;

    @Column({ type: 'varchar', name: 'user_name', length: 50, default: '', comment: '用户账号' })
    public userName: string;

    @Column({ type: 'varchar', name: 'ip', length: 128, default: '', comment: '登录IP地址' })
    public ip: string;

    @Column({ type: 'varchar', name: 'location', length: 255, default: '', comment: '登录地点' })
    public location: string;

    @Column({ type: 'varchar', name: 'browser', length: 50, default: '', comment: '浏览器类型' })
    public browser: string;

    @Column({ type: 'varchar', name: 'os', length: 50, default: '', comment: '操作系统' })
    public os: string;

    @CreateDateColumn({ type: 'timestamp', name: 'login_time', comment: '访问时间' })
    public loginTime: Date;

    //提示消息
    @Column({ type: 'varchar', name: 'msg', length: 255, default: '', comment: '提示消息' })
    public msg: string;
}
